package config_solution

import (
	"flag"

	"algo-sdk-go/common/constant"

	"github.com/zeromicro/go-zero/core/conf"
)

var (
	configFile = flag.String("f", "../../../../algo-algo-go-config/config.yaml", "the config file")
)

type Config struct {
	FeishuWebHookUrl string
	FeishuSecret     string
}

func GetConfig() *Config {
	return &Config{
		FeishuWebHookUrl: constant.FeishuWebHookUrl,
		FeishuSecret:     constant.FeishuSecret,
	}
}

func LoadConfig() *Config {
	c := &Config{}
	conf.MustLoad(*configFile, c)
	return c
}
